//
//  ExtendRequest.h
//  TestForRequest
//
//  Created by admin on 2021/2/26.
//

#import "YTKNetwork.h"

NS_ASSUME_NONNULL_BEGIN
@class ShellRequest,ShellAPIResponse;

//ShellAPIResponse 里面包裹了返回值，状态，和data
typedef void(^ABCAPIResponseBlock)(__kindof ShellAPIResponse * _Nullable response);

typedef NSString *_Nullable(^FinalRequestUrlBlock)(void);
typedef id _Nullable(^FinalRequestArgumentBlock)(void);
typedef YTKRequestMethod (^ _Nullable FinalRequestMethodBlock)(void);
typedef YTKRequestQueryStringSerializationStyle (^ _Nullable FinalShellSerializationStyleBlock)(void);
typedef NSDictionary *_Nullable(^ _Nullable FinalRequestHeaderFieldBlock)(void);
typedef YTKRequestSerializerType (^ _Nullable FinalRequestSerializerTypBlock)(void);

typedef ShellRequest *_Nullable(^ShellStartBlock)(void);
typedef ShellRequest *_Nullable(^ShellRequestCompletionBlock)(ABCAPIResponseBlock);

@interface ShellRequest : YTKRequest

//MARK: 用户可供调用的设置url等的block
@property(nonatomic, copy, readonly)ShellRequest *_Nullable(^requestUrlBlock)(FinalRequestUrlBlock);
@property(nonatomic, copy, readonly)ShellRequest *_Nullable(^requestArgumentBlock)(FinalRequestArgumentBlock);
@property(nonatomic, copy, readonly)ShellRequest *_Nullable(^requestMethodBlock)(FinalRequestMethodBlock);
@property(nonatomic, copy, readonly)ShellRequest *_Nullable(^shellSerializationStyleBlock)(FinalShellSerializationStyleBlock);
@property(nonatomic, copy, readonly)ShellRequest *_Nullable(^shellRequestHeaderFieldBlock)(FinalRequestHeaderFieldBlock);
@property(nonatomic, copy, readonly)ShellRequest *_Nullable(^shellRequestSerializerTypBlock)(FinalRequestSerializerTypBlock);
@property(nonatomic, copy, readonly)ShellRequestCompletionBlock shellSuccessblock;
@property(nonatomic, copy, readonly)ShellRequestCompletionBlock shellFailureblock;

/// 开始请求的block，直接使用，并保证最后使用
@property(nonatomic, copy, readonly)ShellStartBlock startBlock;

// 自定义的成功失败的返回，
@property (nonatomic, copy, nullable) ABCAPIResponseBlock successResponseBlock;
@property (nonatomic, copy, nullable) ABCAPIResponseBlock failureResponseBlock;


@end

NS_ASSUME_NONNULL_END
